<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="coinfaces">

        <title>将Raspbian改造成Server系统</title>

    <link rel="stylesheet" href="../../theme/css/style.css">
    <link rel="stylesheet" href="../../theme/css/pygments.css">



</head>

<body>
    <div class="content">
<h1>将Raspbian改造成Server系统</h1>    <p>
        under
            <a href="../../tags/raspberrypi/">raspberrypi</a>
            <a href="../../tags/raspbian/">raspbian</a>
            <a href="../../tags/reading/">reading</a>
    </p>
    <p>
        in <a href="../../categories/tech/">tech</a>
    </p>
    <p>Published: 2016-09-12</p>


    <p>树莓派创建的初衷是作为一个廉价的教学设备，因此它的操作系统（之一）Raspbian包含了完整的桌面环境，但如果想把它当成一台服务器来用的话，最好先给系统瘦个身，<a class="reference external" href="https://github.com/umiddelb/armhf/wiki/Get-Docker-up-and-running-on-the-RaspberryPi-%28ARMv6%29-in-four-steps-%28Wheezy%29">这篇文章</a>介绍了如何在Raspbian里编译和运行docker，第一步就是删除系统里不需要的软件：</p>
<pre class="literal-block">
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep x11 | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep python | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep sound | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep gnome | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep lxde | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep gtk | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep desktop | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep gstreamer | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep avahi | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep dbus | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v &quot;deinstall&quot; | grep freetype | sed s/install//`
sudo apt-get -y autoremove
sudo apt-get clean
</pre>
<p>这些命令受了<a class="reference external" href="http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/">创建84MB的Raspbian镜像</a>这篇文章的启发，它还详细介绍了作者制作镜像的各步骤和相应的思路，这篇文章还提到了两个被遗漏的部分：用户pi主目录下的python_games目录以及/opt目录。</p>
<p>（完）</p>

    </div>
<nav class="nav sidebar">
    <div class="siteinfo">
        <div class="sitename"><a href="../..">coinfaces</a></div>
        <div class="tagline">Another Side of Life</div>
    </div>

        <a href="../../categories/">categories</a>
        <a href="../..">&larr; Home</a>
</nav><footer class="footer">
    <span>
        &copy; jpli &middot;
        under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</a>
    </span>
    |
    <span>
        Powered by:
        <a href="http://blog.getpelican.com/">Pelican</a>
    </span>
</footer></body>
</html>